﻿try{
    if (document.domain.indexOf("dell.com.") == -1 && document.domain.indexOf("dell.com") != -1) { document.domain = "dell.com"; } else { try { window.location.href; } catch (e) { document.domain = document.domain; } }
}catch(e)
{
}

$ = jQuery ;
$j = jQuery ;

var isCSS = false;
var isW3C = false;
var isIE4 = false;
var isNN4 = false;
var isIE6 = false;
var isGecko = false;
var isOpera = false;
var isDHTML = false;
var suppressMenus = false;
var m_production = true;
var m_menudef = "/content/public/menu.aspx";
var m_isRtl = false;
var m_isCenter = true;
var m_isPopupIntention = false;

function autoconfig()
{
if( document && document.images )
{
isCSS = (document.body && document.body.style) ? true : false;
isW3C = (isCSS && document.getElementById) ? true : false;
isIE4 = (isCSS && document.all && readIEVer() >= 4.0) ? true : false;
isNN4 = (document.layers) ? true : false;
isGecko = (isCSS && navigator && navigator.product && navigator.product == "Gecko");
isOpera = (isCSS && navigator.userAgent.indexOf( "Opera") != -1 );
isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
isIE6 = ( isIE6CSS && readIEVer() >= 6.0 );
isDHTML = isCSS && ( isIE4 || isGecko || isOpera );
if( suppressMenus )
{
isDHTML = false;
}
else if( isOpera && readOperaVer() < 7 )
{
isDHTML = false;
}
else if( isGecko && navigator.productSub <= 20011022 )
{
isDHTML = false;
}
else if( isGecko && navigator.productSub == 20030107 )
{
var x = navigator.userAgent.indexOf( "AppleWebKit" );
if( x > -1 )
{
isDHTML = ( navigator.userAgent.substring( x + 12, x + 15 ) ) > 300;
}
else
{
isDHTML = false;
}
}
}
}
function SetFlashVersion()
{
    var flashversion = 0;
	var MSDetect = false;
	if (navigator.plugins && navigator.plugins.length)
	{
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			if (x.description)
			{
				y = x.description;
				//var digit1 = y.charAt(y.indexOf('.')- 1);
				//var digit2 = y.charAt(y.indexOf('.') - 2);
			    //return digit2 + digit1;
			    //var reg = "/^-?\d+(\.\d+)?$/";
			    var reg = ("\\d+"); //match the first set of integers w/o the decimal for version
			    var matches = new RegExp(reg).exec(y);
			    if(matches[0])
			    {
				    return matches[0];
				}
				else
				{
				    return y.charAt(y.indexOf('.')-1);
			    }
			}
		}
		if (navigator.plugins["Shockwave Flash 2.0"])
		{
			return 2;
		}
	}
	else
	{
		MSDetect = true;
	}
	if( MSDetect )
	{
		var vs = 0;
		for( v=2;v<15;v++ )
		{
			ieFlashObj = null;
			window.execScript('on error resume next: ieFlashObj = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + v + '"))','VBScript');
			if( ieFlashObj )
			{
				vs = v;
			}
		}
		return vs;
	}
	return 0;
}
function readIEVer()
{
	var agent = navigator.userAgent;
	var offset = agent.indexOf( "MSIE" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 5, agent.indexOf( ";", offset ) ) );
}
function BandWidthRedir ( url )
{
	var bWidth = Bandwidth();
	if ( bWidth == "Modem" )
	{
		document.location.href = url ;
	}
}
function readOperaVer()
{
	var agent = navigator.userAgent;
	var offset = agent.indexOf( "Opera" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 6 ) );
}
var offers = new Array();
function AddToOffers( name , html )
{
offers[name] = html;
}
function betaShow ( variantOfferId, mboxId )
{
  var divCnt = document.getElementById  ( mboxId + "_ph" );
  if (divCnt == null)
  {
    try
    {
    mboxFactoryDefault.get(mboxId,0).setOffer(new mboxOfferDefault()).activate(); 
    }
    catch(e)
    {
    }
  }
  else
  {
   var content = offers[variantOfferId];
   if (content == null || content == undefined)
   {
       return;
   }
   content = content.replace('</"+"script>','</script>');
   divCnt.innerHTML =  content;
   
   try{
   var startVar = "JavaScript>";
   var start = content.indexOf("JavaScript\">");
   start = start + startVar.length + 1;
   var endVar = "</script>";
   var end = content.indexOf(endVar);
   var obj = content.substring(start,end)
   eval(obj);
   }
   catch(e)
   {
   }

  }
}

function hmp (pnt,pnm, pntr)
{
    this.PNT= pnt;
    this.PNM = pnm;
    this.PNTR = pntr;
   
    this.render = function ()
    {
		autoconfig();
        dw( '<a name="mastheadtop"></a>' );
        dw('<table id="masthead" class=\"centertable\" cellpadding="0" cellspacing="0" border="0" width="928px"><tr>');
	    
	    var me = this;
	    this.rC ( function (){me.rLogo()} );
	    this.rT ('<td colspan="2" align="right">','</td>', function (){me.rPL()} );
        dw ( '</tr><tr>');

	    this.rT ('<td width="573" valign="bottom">','</td>', function (){me.rM ()} ); 
	    
	    this.rT ('<td width="230" align="right">','</td>', function (){me.rOT()} );
	    
        dw ( '</tr><tr><td colspan="3"><div style="height:15px;"></div></td></tr></table>');
    }
    this.rLogo = function ()
    {
        dw( '<div class="hplogo"></div>');
    }
    this.rT = function ( s,e, c )
    {
        dw ( s );
        
        if ( typeof ( c )  == "function" )
        {
          c();  
        }
        else{
        
            dw ( c );
        }
        dw ( e );
    }
    this.rC = function ( c )
    {
        this.rT( '<td width="127" rowspan="2" valign="bottom">',  '</td>' , c );
        
    }
    this.rOT = function ()
    {
        this.rSB ();
        this.rPN ();
    }
    this.rPL = function ()
    {
        dw ( '<div class="pnlinks">');
        
        if ( m_pnlinks  )
        {
            for (var i=0; i < m_pnlinks.length; i++)
            {
                if ( i != 0 ){ dw('<span>|</span>')}
                dw ( '<a href="' + m_pnlinks[i].Href + '">'+ m_pnlinks[i].Text + '</a>');
                
            }   
        }
        dw ( '</div>');
    }
    this.rSB = function ()
    {
        dw ( '<div class="msbar">');
        if ( m_search )
        {
            dw ( m_search );
        }
		else
		{
			renderSearchLinks();
		}
        dw ( '</div>');
        
    }
    this.rPN = function ()
    {
        dw ( '<div class="mspn">');
        if ( this.PNT )
        {
            this.rT ( '<span>','</span>', this.PNT );
        }
        if ( this.PNM )
        {
            this.rT ( '<span>','</span>', this.PNM );
        }
        if ( this.PNTR )
        {
            this.rT ( '<span>','</span>', this.PNTR );
        }
        
        
    }
    this.rM = function ()
    {
		if ( typeof(m_menuBar) != "undefined" && m_menuBar && m_menuBar.length > 0 )
		{
        	dw ( '<ul class="jd_menu" style="font-size:14px;">');
	        for ( var i = 0; i < m_menuBar.length ;i++ )
	        {
	            var menu = m_menuBar[i];
	            this.rSM ( menu , false   );
	        }
        	dw ( '</ul>');
		}
    }
    
    this.rSM = function ( m  , isSub)
    {   
        var hasItems = m.MenuItems != null && m.MenuItems.length > 0 ;
        var hasLink = m.Href != null && m.Href.length > 0 ;
        var cssClass =  "hpmi";
        if ( hasItems )
        {
            if ( isSub )
            {
                cssClass += " hpmiwc2";
            }
            else
            {
                cssClass += " hpmiwc1";
            }
        }
        dw ( '<li class="' + cssClass + '">');
        
        if ( hasLink )
        {
            dw ( '<a href="' + m.Href + '">');
        }
        else{
            
	    if(m_isRtl)
	    {
	    	dw ( '<div>');
	    }
	    else
	    {
		dw ( '<span>');
	    }
	    
	   
        }
        dw ( m.Text );
        if ( hasLink )
        {
             dw  ( '</a>');
        }
        else
        {
          
	    if(m_isRtl)
	    {
	    	dw ( '</div>');
	    }
	    else
	    {
		dw ( '</span>');
	    }
	  
        }
       
        if ( hasItems )
        {
            dw ( '<ul style="font-size:12px;">');
            for ( var i = 0 ; i < m.MenuItems.length ;i++ )
            {
                this.rSM ( m.MenuItems[i] ,true );
            }
            dw ( '</ul>');
        }
        
        dw ('</li>');
    }
}

function renderSearchLinks()
{
if( m_searchLinks )
{
for( var n = 0; n < m_searchLinks.length; n++ )
{
if( n > 0 )
{
dw( "<span class=\"mhSpace\">|</span>" );
}
var href = m_searchLinks[n].Href;
var text = m_searchLinks[n].Text;
dw( "<span class=\"mh_search_sep_SE\" style=\"white-space:nowrap\"><a href=\"" + href + "\" class=\"para_small\">" + text + "</a></span>" );
}
}
}

function writeMH( pnt, pnm, pntr, segmentTitle, hasLocale, logoLink, pnmsg )
{
   
   var hmpi = new hmp(pnt,pnm, pntr);
   
   hmpi.render ();
   
   jQuery(function(){jQuery('ul.jd_menu').jdMenu();});


}


function dw (line)
{
    document.write ( line );
}



 function StringBuffer() { 
   this.buffer = []; 
 } 

 StringBuffer.prototype.append = function append(string) { 
   this.buffer.push(string); 
   return this; 
 }; 

 StringBuffer.prototype.toString = function toString() { 
   return this.buffer.join(""); 
 }; 
 
 StringBuffer.prototype.writeToDocument = function () { 
   for ( var i =0; i < this.buffer.length ;i++ )
   {
        document.write ( this.buffer[i]);
   }
 }; 
 
 
 
//from common
var m_stdEmpty = "";
var m_mhFixed = false;
var isReady = false;
var m_crumbs;
var m_pnlinks ;
var m_isHome = true;
var m_metricsPathMapping;

function sReady()
{
    $j(document).ready (
        function (){isReady = true; $j(document).triggerHandler( 'sReady');}
    );
    aitd();
}
function addsReady ( fn )
{
    jQuery(document).bind ( 'sReady' , fn);
}
function aitd ()
{   
    if ( m_isPopupIntention )
    {
        try{
       jQuery.each(document.body.childNodes, function(i, val) {
        if ( $j(val).is('table'))$j(val).css('width','100%');
        });
        }
        catch(e){}
    }  
}

function RenderFlash()
{

var flashObjects = ParseDivObjects( "flashContentDiv" );

var flashObject;


for( var flashIdx = 0; flashIdx < flashObjects.length; flashIdx++ )
{
var jscriptTxt  = unescape(flashObjects[flashIdx].innerHTML).replace( /&amp;/gi, "&");
if ( jscriptTxt.indexOf("new FlashLibraryActivate") > -1 )
{
try
{
//  if(checkforLinuxOS())
//  {
//    flashObjects[flashIdx].style.display = "block";
//	flashObjects[flashIdx].innerHTML = alternateMarkup;
//  }
//  else
//  {
    var flashObj = eval(jscriptTxt);
    var fullscreen = getQueryVariable( "~lt" );
    if( fullscreen == "flash_fullscreen" )
    {
     document.body.style.margin = 0;
     document.body.style.padding = 0;
     document.body.innerHTML = flashObj.getPluginTag();
    }
    else
    {
     flashObjects[flashIdx].innerHTML = flashObj.getPluginTag();
     flashObjects[flashIdx].style.display = "block";
    }
   //}
}
catch(e){}
}
}
}

function checkforLinuxOS()
{
    var agt=navigator.userAgent.toLowerCase();
	if(agt.indexOf('linux') > -1)
 //   if(agt.indexOf('windows') > -1)
	{
	    return true;
	}
	else
	{
	    return false;
	}
	
}


function FlashLibraryActivate( swfFile, width, height, bgcolor, ver, altFormat, params, movieName, quality, scaleMode, allowFS, wMode, menu, contentFile  )
{
	var t = this;
	var activeX = false;
	t.ieAutoInstall = false;
	
	
	if( quality == undefined || quality == "" )
	{
		quality = "high";
	}
	if( scaleMode == undefined || scaleMode == "")
	{
		scaleMode = "noscale";
	}
	if( wMode == undefined || wMode == "" )
	{
		wMode = "opaque";
	}
	if( allowFS == undefined || allowFS == "" )
	{
		allowFS = "true";
	}
	if( menu == undefined || menu == "" )
	{
		menu = "true";
	}
	if( ver == undefined || ver == "" )
	{
		ver = "7";
	}
	
	t.hasVersion = function( ver )
	{
		t.swf = false;
		if( !ver ) ver = 0;
		
		if(checkforLinuxOS())
	    {
	        return false;
	    }
	    
		var n = navigator;
		if(n.plugins && n.plugins.length > 0)
		{
			var m,tp,d,v;
			m = n.mimeTypes;
			tp = 'application/x-shockwave-flash';
			if(m && m[tp] && m[tp].enabledPlugin && m[tp].enabledPlugin.description)
			{
				d = m[tp].enabledPlugin.description;
				//v = d.charAt(d.indexOf('.')-1);
				v = SetFlashVersion();
				t.swf = (v >= ver) ? true : false;
			}
		}
		else if ( n.appVersion.indexOf("Mac") == -1 && window.execScript )
		{
			ieFlashObj = null;
			activeX = true;
			for(var i=ver; i<=10&&i!=1&& ieFlashObj!=true; i++)
			{
				execScript('on error resume next: ieFlashObj=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash'+((i==0)?'':'.'+i)+'"))','VBScript');
				if ( ieFlashObj == true )
				{
					t.swf = true;
					break;
				}
			}
		}
		else
		{
			t.swf = false;
		}
		return t.swf;
	}
	
	t.getPluginTag = function()
	{
		var fixedVer = ver;		
			var cmHack= swfFile.indexOf ( "cmhack" )> -1;
		if ( cmHack )
		{
			if ( document.location.href.indexOf ( "~bandwidth=Modem" ) == -1 && !t.hasVersion( parseInt( ver ) ) )
			{
				document.location.href = document.location.href + "&~bandwidth=Modem";
			}
		}
	
		if ( swfFile.indexOf ( "autoinstall" ) > -1 )
		{
			t.ieAutoInstall = true;
		}
		
		params = " " + params + " ";
		var s = "";
		var win = ( navigator.appVersion.toLowerCase().indexOf( "win" ) != -1 );
		var ie = ( navigator.appName == "Microsoft Internet Explorer" );
		
		
		if( ( t.hasVersion( parseInt( ver ) ) && swfFile ) || ( win && ie && swfFile && t.ieAutoInstall ) )
		{
			
			var additionalParams = '';
			var qPos = swfFile.indexOf ( "?" )
			var fVars = swfFile.substr( qPos + 1, swfFile.length );

			if ( ( qPos > -1 ) && ( qPos + 1 < swfFile.length ) && ( parseInt( fixedVer ) > 5 ) )
			{
				var ta = 'FlashVars';
				var v = swfFile.substring ( qPos + 1 );
				v += "&containerURL=" + encodeURIComponent( location.href );
				v += "&id=" + movieName;
				additionalParams += ( activeX ) ? '\t<param name="' + ta + '" value="' + v + '" />\n': ' '+ ta + '="' + v + '"';
			}
			else
			{
				var ta = 'FlashVars';
				var v = "";
				v += "containerURL=" + encodeURIComponent( location.href );
				v += "&id=" + movieName;
				additionalParams += ( activeX ) ? '\t<param name="' + ta + '" value="' + v + '" />\n': ' '+ ta + '="' + v + '"';
			}
			if( qPos > -1 )
			{
				swfFile = swfFile.substr( 0, qPos );
			}
	
			if( activeX )
			{
				var pcol = (window.location.protocol == 'https:') ? "https:" : "http:";
				s = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' + pcol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + fixedVer + '" id="' + movieName + '" width="' + width + '" height="' + height + '" >\n';
				s += '\t<param name="movie" value="' + swfFile + '" />\n';
				s += '\t<param name="allowFullScreen" value="' + allowFS + '" />\n';
				s += '\t<param name="quality" value="' + quality + '" />\n';
				s += '\t<param name="menu" value="' + menu + '" />\n';
				s += '\t<param name="wmode" value="' + wMode + '" />\n';
				s += '\t<param name="allowScriptAccess" value="always">\n';			
				s += '\t<param name="bgcolor" value="' + bgcolor + '" />\n';
				s += '\t<param name="scale" value="' + scaleMode + '" />\n';
				s += additionalParams;
				s += params;
				s += altFormat;
				s += '</object>\n\n';
	
				// create the <iframe> IF the contentfile attribute is present
				try
				{
					if( contentFile != undefined && contentFile != "" )
					{
						s += '<iframe id="" name="" src="' + contentFile + '" style="display:none" title="" align="left" frameborder="0" height="1" weight="1" longdesc="" marginheight="0" marginwidth="0" scrolling="no" ></iframe>';
					}
					else
					{
					}
				}
				catch(e)
				{
					
				}
				return s;
			}
			else
			{
				// EMBED
				s = '<embed src="' + swfFile + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" allowScriptAccess="always" wmode="' + wMode + '" allowFullScreen="' + allowFS + '" type="application/x-shockwave-flash" name="' + movieName + '" id="' + movieName + '" width="' + width + '" height="' + height + '" bgcolor="' + bgcolor + '"'+ additionalParams+params + '" menu="' + menu + '" scale="' + scaleMode + '" ></embed>\n';
				
				
				try
				{
					if( contentFile != undefined && contentFile != "" )
					{
						s += '<iframe id="" name="" src="' + contentFile + '" style="display:none" title="" align="left" frameborder="0" height="1" weight="1" longdesc="" marginheight="0" marginwidth="0" scrolling="no"></iframe>';
					}
				}
				catch(e)
				{
					
				}
				return s;
			}
		}
		else
		{
			return altFormat;
		}
	}
}

function getQueryVariable(variable)
{
      var query = window.location.search.substring(1);
      var vars = query.split("&");
      for (var i=0;i<vars.length;i++)
      {
            var pair = vars[i].split("=");
            if (pair[0] == variable)
            {
                  return pair[1];
            }
      }
}

function ParseDivObjects( targetName )
{
   
	var objs = document.getElementsByName( targetName );
	if( objs.length == 0 )
	{
		var targets = document.getElementsByTagName( "DIV" );
		var tmpObj;
		objs = new Array();
		for( var targetidx = 0; targetidx < targets.length; targetidx++ )
		{
			tmpObj = targets[targetidx];
			if( tmpObj.name == targetName )
			{
				objs.push( tmpObj );
			}
		}
	}
	return objs;
}




function addPnLink( text, href, icon )
{
	if( !m_pnlinks )
	{
		m_pnlinks = new Array();
	}
	m_pnlinks[m_pnlinks.length] = new mhLink( text, href, icon, "&~ck=pn" );
}

function writeLocaleSelector()
{
var str_ctry_flag="";
if (flag)
{
str_ctry_flag = "<td><img style=\"float:left;\" src=\"" + m_imgPfx + "/images/global/masthead/smlflags/" + flag + ".gif\" alt=\"\" border=\"0\" /></td>";
}
if (m_localeSelector != null && m_localeSelector.length > 0)
{
dw( "<table class=\"locale_selector\"><tr>"+str_ctry_flag+"<td>" + m_localeSelector + "</td></tr></table>");
}
}
function writeFooterStart()
{
	var width = ( m_mhFixed ? (m_mastheadWidth+"px") : "100%" );
	
	document.write( "<div style=\"width:100%;padding-top:10px;\">");
	if( typeof( m_pageTheme ) != "undefined" )
	{
		if( m_pageTheme != null && m_pageTheme.length > 0 )
		{
			document.write( "<div style=\"clear:left;\"><img src=\"" )
			document.write( m_pageTheme );
			document.write( "\" border=\"0\" alt=\"\" /></div>" );
		}
	}
	if( m_crumbs )
	{
		renderFooterCrumbs();
	}
	document.write( "</div>" );
}
function writeFooterMid()
{
	var width = ( m_mhFixed ? m_mastheadWidth : "100%" );
	var sepCol = "#cccccc";
	if( !m_crumbs && !m_isHome )
	{
		document.write( "<table width=\"" + width + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ededed\">" );
		document.write( "<tr><td colspan=\"2\" bgcolor=\"" + sepCol + "\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" /></td></tr>" );
		document.write( "<tr><td colspan=\"2\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" /></td></tr><tr><td bgcolor=\"#ffffff\" width=\"" + width + "\" valign=\"top\">" );
	}
}
function writeFooterBegin()
{
	writeFooterStart();
	writeFooterMid();
}
function writeFooterClose()
{
}

function mhLink( text, href, icon, extra, isFilter )
{
	href = mhFixupLink( href, extra );
	this.Text = text;
	this.Href = href;
	this.Icon = icon;
	this.IsFilter = isFilter;
}


function menuRef( id, text, href, items, target )
{
	menuRef( id, text, href, items, target, false )
}
function menuRef( id, text, href, items, target, selected )
{
	this.Id = id;
	this.Text = text;
	this.Href = mhFixupLink( href, "&~ck=mn" );
	this.IsSeparator = false;
	this.IsCaption = false;
	this.MenuItems = items;
	this.IsSelectedTab = false;
	if( selected == true )
	{
		this.IsSelectedTab = true;
	}
	this.OffDell = false;
	this.TargetHtml = m_stdEmpty;
	if( ( typeof(target) != "undefined" ) && target )
	{
		this.OffDell = ( target == "offdell" );
		this.TargetHtml = " target=\"" + target + "\"";
	}
}
function menuItem( text, href, target, icon )
{
	this.Text = text;
	this.Href = mhFixupLink( href, "&~ck=mn" );
	this.IsSeparator = false;
	this.IsCaption = false;
	this.IconUrl = icon;
	this.MenuItems = null;
	this.OffDell = false;
	this.TargetHtml = m_stdEmpty;
	if( ( typeof(target) != "undefined" ) && target )
	{
		this.OffDell = ( target == "offdell" );
		this.TargetHtml = " target=\"" + target + "\"";
	}
}
function menuCaption( text )
{
	this.Text = text;
	this.Href = null;
	this.IsSeparator = false;
	this.IsCaption = true;
	this.MenuItems = null;
}
function menuSep()
{
	this.IsSeparator = true;
	this.IsCaption = false;
}

function mhFixupLink( href, extra )
{
	if( typeof(extra) == "undefined" )
	{
		extra = "&~ck=mn";
	}
	if( href )
	{
		var anchor = null;
		var anchorix = href.indexOf( "#" );
		if( anchorix != -1 )
		{
			anchor = href.substr( anchorix );
			href = href.substr( 0, anchorix );
		}
		if( href.indexOf( "?" ) == -1 )
		{
			extra = "?" + extra.substr( 1 );
		}
		if( href.toLowerCase().indexOf( "javascript:" ) == -1 )
		{
			href += extra;
		}
		else
		{
			start = href.indexOf( "?" );
			if( start != -1 )
			{
				ix = href.indexOf( "\'", start );
				if( ix == -1 )
				{
					ix = href.indexOf( "\\", start );
					if( ix == -1 )
					{
						ix = href.indexOf( "\"", start );
					}
				}
				if( ix != -1 )
				{
					href = href.substr( 0, ix ) + extra + href.substr( ix );
				}
			}
		}
		if( anchor )
		{
			href += anchor;
		}
	}
	return href;
}
var hostname = document.location.hostname.toLowerCase();
/* please dont enable this. this screws up cloaking 
if ( hostname == "www.ap.dell.com" || hostname == "ap.dell.com" ){document.location.replace ("http://www1.ap.dell.com/content/default.aspx?c=ap&l=en&s=gen");}
if ( hostname == "www.euro.dell.com" ){document.location.replace ("http://www1.euro.dell.com/content/default.aspx?c=eu&s=gen&l=en");}
if ( hostname == "www.jp.dell.com" || hostname == "dell.co.jp" || hostname == "jp.dell.com" || hostname == "www.dell.co.jp" ){document.location.replace ("http://www1.jp.dell.com/content/default.aspx?c=jp&l=jp&s=gen");}*/
/* OnlineOpinion (S3t,1424b) */
/* This product and other products of OpinionLab, Inc. are protected by U.S. Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
var custom_var,_sp='%3A\\/\\/',_rp='%3A//',_poE=0.0, _poX=0.0,_sH=screen.height,_d=document,_w=window,_ht=escape(_w.location.href),_hr=_d.referrer,_tm=(new Date()).getTime(),_kp=0,_sW=screen.width;_d.onkeypress=_fK;function _fK(_e){if(!_e)_e=_w.event;var _k=(typeof _e.which=='number')?_e.which:_e.keyCode;if((_kp==15&&_k==12))_w.open('https://secure.opinionlab.com/pageviewer/pv_controlboard.html?url='+_fC(_ht),'PageViewer','height=529,width=705,screenX='+((_sW-705)/2)+',screenY='+((_sH-529)/2)+',top='+((_sH-529)/2)+',left='+((_sW-705)/2)+',status=yes,toolbar=no,menubar=no,location=no,resizable=yes');_kp=_k};function _fC(_u){_aT=_sp+',\\/,\\.,-,_,'+_rp+',%2F,%2E,%2D,%5F';_aA=_aT.split(',');for(i=0;i<5;i++){eval('_u=_u.replace(/'+_aA[i]+'/g,_aA[i+5])')}return _u};function O_LC(){_w.open('http://ccc01.opinionlab.com/comment_card.asp?time1='+_tm+'&time2='+(new Date()).getTime()+'&prev='+_fC(escape(_hr))+'&referer='+_fC(_ht)+'&height='+_sH+'&width='+_sW+'&custom_var='+custom_var,'comments','width=535,height=192,screenX='+((_sW-535)/2)+',screenY='+((_sH-192)/2)+',top='+((_sH-192)/2)+',left='+((_sW-535)/2)+',resizable=yes,copyhistory=yes,scrollbars=no')};function _fPe(){if(Math.random()>=1.0-_poE){O_LC();_poX=0.0}};function _fPx(){if(Math.random()>=1.0-_poX)O_LC()};window.onunload=_fPx;function O_GoT(_p){_d.write('<a href=\'javascript:O_LC()\'>'+_p+'</a>');_fPe()}
function doOpionlabs( _p)
{
var pageSeg = getCookieKeyValue("lwp","s");
var pageLang = getCookieKeyValue("lwp","l");
var pageCnty = getCookieKeyValue("lwp","c");
var pageCS = getCookieKeyValue("lwp","cs");
var metricPath = null;
var metas = document.getElementsByTagName ( "META");
var _lG =pageLang + "-" + pageCnty + ".";
if ( pageLang == "jp" )
{
_lG = "ja-JP.";
}
else if ( pageLang == "en")
{
_lG = "";
}
if ( metas != null )
{
for ( i = 0 ; i < metas.length ; i ++)
{
if ( metas[i].name== "METRICSPATH" )
{
metricPath = metas[i].getAttribute("CONTENT");
if ( metricPath != null && metricPath.length > 9)
{
metricPath = metricPath.substring( 9 );
}
break;
}
}
}
var ssid = getCookie ( "SITESERVER" );
if ( ssid != null && ssid.length > 3 )
{
ssid = ssid.substring ( 3 );
}
custom_var = metricPath + "|" + ssid + "|" + pageSeg;
_rp='%3A//'+_lG;
if ( _p != null )
{
O_GoT(_p);
}
}
function getCookieKeyValue( cname, id )
{
try
{
var sid = id + "=";
var lwp = getCookie( cname );
var startIdx = 0;
var endIdx = 0;
if( lwp.indexOf(sid) == -1 )
{
return null;
}
else
{
startIdx = lwp.indexOf(sid) + id.length + 1;
if( lwp.substring( startIdx ).indexOf( "&" ) == -1 )
{
return lwp.substring( startIdx ).toLowerCase();
}
else
{
endIdx = lwp.substring( startIdx ).indexOf( "&" ) + startIdx;
}
}
return lwp.substring( startIdx, endIdx ).toLowerCase();
}
catch(e)
{}
return null;
}
function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)
{
begin += NameOfCookie.length + 1;
end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = document.cookie.length;
}
return unescape( document.cookie.substring(begin, end));
}
}
return "";
}
function winopen(url,stuff,morestuff)
{
var popwin = window.open(url,stuff,morestuff);
if( typeof(popwin) != "undefined" && popwin )
{
popwin.focus();
}
lastPopup = popwin;
}
//end from common

//start of jquery additions


/*
 * jdMenu 1.4.1 (2008-03-31)
 *
 * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://jdsharp.us/
 *
 * Built upon jQuery 1.2.1 (http://jquery.com)
 * This also requires the jQuery dimensions >= 1.2 plugin
 */

// This initializes the menu
$(function() {
	$('ul.jd_menu').jdMenu();
});

(function($){
	function addEvents(ul) {
		var settings = $.data( $(ul).parents().andSelf().filter('ul.jd_menu')[0], 'jdMenuSettings' );
		$('> li', ul)
			.bind('mouseenter.jdmenu mouseleave.jdmenu', function(evt) {
				$(this).toggleClass('jdm_hover');
				var ul = $('> ul', this);
				if ( ul.length == 1 ) {
					clearTimeout( this.$jdTimer );
					var enter = ( evt.type == 'mouseenter' );
					var fn = ( enter ? showMenu : hideMenu );
					this.$jdTimer = setTimeout(function() {
						fn( ul[0], settings.onAnimate, settings.isVertical );
					}, enter ? settings.showDelay : settings.hideDelay );
				}
			})
			.bind('click.jdmenu', function(evt) {
				var ul = $('> ul', this);
				if ( ul.length == 1 && 
					( settings.disableLinks == true || $(this).hasClass('accessible') ) ) {
					showMenu( ul, settings.onAnimate, settings.isVertical );
					return false;
				}
				
				// The user clicked the li and we need to trigger a click for the a
				if ( evt.target == this ) {
					var link = $('> a', evt.target).not('.accessible');
					if ( link.length > 0 ) {
						var a = link[0];
						if ( !a.onclick ) {
							window.open( a.href, a.target || '_self' );
						} else {
							$(a).trigger('click');
						}
					}
				}
				if ( settings.disableLinks || 
					( !settings.disableLinks && !$(this).parent().hasClass('jd_menu') ) ) {
					//$(this).parent().jdMenuHide();
					evt.stopPropagation();
				}
			})
			.find('> a')
				.bind('focus.jdmenu blur.jdmenu', function(evt) {
					var p = $(this).parents('li:eq(0)');
					if ( evt.type == 'focus' ) {
						p.addClass('jdm_hover');
					} else { 
						p.removeClass('jdm_hover');
					}
				})
				.filter('.accessible')
					.bind('click.jdmenu', function(evt) {
						evt.preventDefault();
					});
	}

	function showMenu(ul, animate, vertical) {
		var ul = $(ul);
		if ( ul.is(':visible') ) {
			return;
		}
		ul.bgiframe();
		var li = ul.parent();
		ul	.trigger('jdMenuShow')
			.positionBy({ 	target: 	li[0], 
							targetPos: 	( vertical === true || !li.parent().hasClass('jd_menu') ? 1 : 3 ), 
							elementPos: 0,
							hideAfterPosition: true
							});
		if ( !ul.hasClass('jdm_events') ) {
			ul.addClass('jdm_events');
			addEvents(ul);
		}
		li	.addClass('jdm_active')
			// Hide any adjacent menus
			.siblings('li').find('> ul:eq(0):visible')
				.each(function(){
					hideMenu( this ); 
				});
		if ( animate === undefined ) {
			ul.show();
		} else {
			animate.apply( ul[0], [true] );
		}
	}
	
	function hideMenu(ul, animate) {
		var ul = $(ul);
		$('.bgiframe', ul).remove();
		ul	.filter(':not(.jd_menu)')
			.find('> li > ul:visible')
				.each(function() {
					hideMenu( this );
				})
			.end();
		if ( animate === undefined ) {
			ul.hide()
		} else {
			animate.apply( ul[0], [false] );
		}

		ul	.trigger('jdMenuHide')
			.parents('li:eq(0)')
				.removeClass('jdm_active jdm_hover')
			.end()
				.find('> li')
				.removeClass('jdm_active jdm_hover');
	}
	
	
	$.fn.jdMenu = function(settings) {
		
		var settings = $.extend({	
									showDelay: 		200,
									
									hideDelay: 		500,
									
									disableLinks:	false
									
									}, settings);
		if ( !$.isFunction( settings.onAnimate ) ) {
			settings.onAnimate = undefined;
		}
		return this.filter('ul.jd_menu').each(function() {
			$.data(	this, 
					'jdMenuSettings', 
					$.extend({ isVertical: $(this).hasClass('jd_menu_vertical') }, settings) 
					);
			addEvents(this);
		});
	};
	
	$.fn.jdMenuUnbind = function() {
		$('ul.jdm_events', this)
			.unbind('.jdmenu')
			.find('> a').unbind('.jdmenu');
	};
	$.fn.jdMenuHide = function() {
		return this.filter('ul').each(function(){ 
			hideMenu( this );
		});
	};

	// Private methods and logic
	$(window)
		// Bind a click event to hide all visible menus when the document is clicked
		.bind('click.jdmenu', function(){
			$('ul.jd_menu ul:visible').jdMenuHide();
		});
})(jQuery);


/*
 * positionBy 1.0.7 (2008-01-29)
 *
 * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://jdsharp.us/
 *
 * Built upon jQuery 1.2.2 (http://jquery.com)
 * This also requires the jQuery dimensions plugin
 */
(function($){
	
	
	// Our range object is used in calculating positions
	var Range = function(x1, y1, x2, y2) {
		this.x1	= x1;	this.x2 = x2;
		this.y1 = y1;	this.y2 = y2;
	};
	Range.prototype.contains = function(range) {
		return 	(this.x1 <= range.x1 && range.x2 <= this.x2) 
				&& 
				(this.y1 <= range.y1 && range.y2 <= this.y2);
	};
	Range.prototype.transform = function(x, y) {
		return new Range(this.x1 + x, this.y1 + y, this.x2 + x, this.y2 + y);
	};

	$.fn.positionBy = function(args) {
		var date1 = new Date();
		if ( this.length == 0 ) {
			return this;
		}
		
		var args = $.extend({	
								target:		null,
								
								targetPos:	null,
								
								elementPos:	null,
								
								
								x:			null,
								y:			null,

								
								positions:	null,

								
								addClass: 	false,
								
								
								force: 		false,
								
								
								container: 	window,

								
								hideAfterPosition: false
							}, args);

		if ( args.x != null ) {
			var tLeft	= args.x;
			var tTop	= args.y;
			var tWidth	= 0;
			var tHeight	= 0;
			

		} else {
			var $target	= $( $( args.target )[0] );
			var tWidth	= $target.outerWidth();
			var tHeight	= $target.outerHeight();
			var tOffset	= $target.offset();
			var tLeft	= tOffset.left;
			var tTop	= tOffset.top;
		}

        isIE = readIEVer() != 0 ? true : false;
        if(m_isRtl)
        {
            if(isIE)
            {
                tLeft = $target[0].getBoundingClientRect().left - 20;
            }
	    //replace with dom width submenu width - main menu width
	    tLeft = tLeft - 87;
        }
        
		var tRight	= tLeft + tWidth;
		var tBottom	= tTop + tHeight;

		return this.each(function() {
			var $element = $( this );

			if ( !$element.is(':visible') ) {
				$element.css({	left:  		-3000, 
								top: 		-3000
								})
								.show();
			}

			var eWidth	= $element.outerWidth();
			var eHeight	= $element.outerHeight();
	
			var position = [];
			var next	 = [];
	
			

			position[0]	= new Range(tRight, 			tTop, 				tRight + eWidth, 	tTop + eHeight);
			next[0]		= [1,7,4];
		
			position[1]	= new Range(tRight, 			tBottom - eHeight, 	tRight + eWidth, 	tBottom);
			next[1]		= [0,6,4];
		
			position[2] = new Range(tRight, 			tBottom,			tRight + eWidth, 	tBottom + eHeight);
			next[2]		= [1,3,10];
		
			position[3] = new Range(tRight - eWidth, 	tBottom,			tRight, 			tBottom + eHeight);
			next[3]		= [1,6,10];
			
			position[4] = new Range(tLeft, 				tBottom,			tLeft + eWidth, 	tBottom + eHeight);
			next[4]		= [1,6,9];
		
			position[5] = new Range(tLeft - eWidth, 	tBottom, 			tLeft, 				tBottom + eHeight);
			next[5]		= [6,4,9];
		
			position[6] = new Range(tLeft - eWidth, 	tBottom - eHeight,	tLeft, 				tBottom);
			next[6]		= [7,1,4];
			
			position[7] = new Range(tLeft - eWidth, 	tTop,				tLeft, 				tTop + eHeight);
			next[7]		= [6,0,4];
			
			position[8] = new Range(tLeft - eWidth, 	tTop - eHeight,		tLeft, 				tTop);
			next[8]		= [7,9,4];
			
			position[9] = new Range(tLeft, 				tTop - eHeight,		tLeft + eWidth, 	tTop);
			next[9]		= [0,7,4];
			
			position[10]= new Range(tRight - eWidth, 	tTop - eHeight,		tRight, 			tTop);
			next[10]	= [0,7,3];
		
			position[11]= new Range(tRight, 			tTop - eHeight, 	tRight + eWidth, 	tTop);
			next[11]	= [0,10,3];
			
			position[12]= new Range(tRight - eWidth, 	tTop,				tRight, 			tTop + eHeight);
			next[12]	= [13,7,10];
			
			position[13]= new Range(tRight - eWidth, 	tBottom - eHeight,	tRight, 			tBottom);
			next[13]	= [12,6,3];
			
			position[14]= new Range(tLeft, 				tBottom - eHeight,	tLeft + eWidth, 	tBottom);
			next[14]	= [15,1,4];
			
			position[15]= new Range(tLeft, 				tTop,				tLeft + eWidth, 	tTop + eHeight);
			next[15]	= [14,0,9];
	
			if ( args.positions !== null ) {
				var pos = args.positions[0];
			} else if ( args.targetPos != null && args.elementPos != null ) {
				var pos = [];
				pos[0] = [];
				pos[0][0] = 15;
				pos[0][1] = 7;
				pos[0][2] = 8;
				pos[0][3] = 9;
				pos[1] = [];
				pos[1][0] = 0;
				pos[1][1] = 12;
				pos[1][2] = 10;
				pos[1][3] = 11;
				pos[2] = [];
				pos[2][0] = 2;
				pos[2][1] = 3;
				pos[2][2] = 13;
				pos[2][3] = 1;
				pos[3] = [];
				pos[3][0] = 4;
				pos[3][1] = 5;
				pos[3][2] = 6;
				pos[3][3] = 14;

				var pos = pos[args.targetPos][args.elementPos];
			}
			var ePos = position[pos];
			var fPos = pos;

			if ( !args.force ) {
				$window = $( window );
				var sx = $window.scrollLeft();
				var sy = $window.scrollTop();
				
				var container = new Range( sx, sy, sx + $window.width(), sy + $window.height() );
	
				var stack;
				if ( args.positions ) {
					stack = args.positions;
				} else {
					stack = [pos];
				}
				var test = [];		
				while ( stack.length > 0 ) {
					var p = stack.shift();
					if ( test[p] ) {
						continue;
					}
					test[p] = true;
	
					if ( !container.contains(position[p]) ) {
						if ( args.positions === null ) {
							stack = jQuery.merge( stack, next[p] );
						}
					} else {
						ePos = position[p];
						break;
					}
				}
			}

			$element.parents().each(function() {
				var $this = $(this);
				if ( $this.css('position') != 'static' ) {
					var abs = $this.offset();
					ePos = ePos.transform( -abs.left, -abs.top );
					return false;
				}
			});
		
			var css = { left: ePos.x1, top: ePos.y1 };
			if ( args.hideAfterPosition ) {
				css['display'] = 'none';
			}
			$element.css( css );

			if ( args.addClass ) {
				$element.removeClass( 'positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 '
									+ 'positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 '
									+ 'positionBy12 positionBy13 positionBy14 positionBy15')
						.addClass('positionBy' + p);
			}
		});
	};
})(jQuery);


function stormModalObj()
{
    this.Inited= false;
}

stormModalObj.prototype.init = function ()
{
   if ( this.Inited )
   {
        return;
   }
   
   var standardModel = '<div class="jqmWindow" id="standardModel"><div class="jqmWinHeader jqDrag" ><div class="jqmClose" onclick="stormModal.close()"><image src="' + m_imgPfx + '/images/global/brand/icons/modal_close_btn.gif" border="0" /></div><div class="jqmWinTitle"></div></div><div class="jqmContent"></div><div class="jqmFooter"><div class="jqmFooterButtons"></div><div class="jqmFooterStatus"></div></div></div>';
   $j(standardModel).appendTo('body');
   
   $j('#standardModel').jqm( );
   this.InternalModal= $j('#standardModel') ;
   this.DefaultProps = { defaultTitle: "&nbsp;"  , width : this.InternalModal.width() };
   this.AbsoluteHeight = 0;
   this.Title  = this.InternalModal.find( '.jqmWinTitle');
   this.Footer  = this.InternalModal.find( '.jqmFooter');
   this.FooterStatus  = this.Footer.find( '.jqmFooterStatus');
   this.FooterButtons  = this.Footer.find( '.jqmFooterButtons');
   
   this.Content = this.InternalModal.find( '.jqmContent');
   this.DummbyAnchor = $j('<div href=foo  ><div>');
   this.Inited=true;
}
stormModalObj.prototype.addclick = function ( t )
{
    t.each  ( function (){ 
        
        $j(this).click ( function ()
            { 
            var map= {};
            map.href = $j(this).attr ('href');
            stormModal.show ( map );
            $j(this).blur();
	        return false;
            }
        )}
        );
}
stormModalObj.prototype.loginRequired = function (  map )
{

    if ( map.authLevel   && map.authLevel > _curAuthLevel )
    {
        return true;
    }
    return false;
   
}

stormModalObj.prototype.ResetHref = function ( map  )
{
    if ( map.elm )
    {
        $j(map.elm).attr ( 'href' , 'javascript:void(0)');
    }
}



stormModalObj.prototype.show = function ( map  , forlogin )
{

    this.init();
  
    if ( !forlogin )
    {
        this.continueMap = null;
    }
   
    if ( this.loginRequired ( map ) || map.swaplogin )
    {
    
        this.ResetHref(map);
        this.continueMap = map;
       
        this.showLogin ( map );
        this.continueMap.swaplogin = false;
        return;
    }
    if (map.top)
    {
        window.location.href=map.href;
        return false;
    }
    
    
    var etrig  = this.DummbyAnchor;
    etrig.attr ( 'href' , map.href );
    this.close();
    
    var mm = jQuery.extend({}, this.DefaultProps, (map ? map : {}));

    this.setprops( mm );
    
    this.InternalModal.jqmShow (  );
    
    this.loadContent ( mm );
    this.positionModal();
    this.lockModal(mm);
     $j(this).blur();
     this.ResetHref(map);
    
    
	return false;
    
}


stormModalObj.prototype.lockModal = function(map)
{
   var ol = $j(document).find('.jqmOverlay');
  
 if (map.lock)
 {
   ol.css('cursor','wait');
   ol.unbind();

 }
 else
 {
  ol.css('cursor','');

 }
}

stormModalObj.prototype.positionModal = function()
{

var scrollTop = (document.all)? ( truebody().scrollTop) : window.pageYOffset;
var scrollLeft = (document.all)? ( truebody().scrollLeft) : window.pageXOffset;
var clientHeight = (document.all)? ( truebody().clientHeight) : document.body.clientHeight;
var clientWidth = (document.all)? ( truebody().clientWidth) : document.body.clientWidth;

var elm = this.InternalModal;
var left=0, top=0;
top  = scrollTop + clientHeight/2 - elm.height()/2;
left = scrollLeft + clientWidth/2 ;

var cssObj = {
        left: left+"px",
        top: top+"px"
      };
elm.css(cssObj);

}

stormModalObj.prototype.loadContent = function ( map  ) 
{
    
    var r = this.Content;
    if (map.contentid)
    {
        var elmObj = $j('#' + map.contentid);
        if (elmObj)
        {
        var elmContent =  elmObj.html()
        r.html (elmContent);
        }
        return;
    }
    var processing = "<div class=\"waitcls\">" + m_processingcaption + "<img src=\""+ m_imgPfx +"/images/global/brand/icons/ajax-loader[1].gif\" border=\"0\"/></div>";
  
    if ( map.href.substr(0,4) == 'http' || map.iframe )
        {
            r.height( this.AbsoluteHeight -85);
          
            r.html(processing + '<iframe style="display:block" width="100%" height="100%" onload="$j(this).css ( \'display\',\'block\');$j(\'.waitcls\').css(\'display\', \'none\'); " style="height:100%" frameborder="0" hspace="0" src="' + map.href +'" />');
        }
        else
        {
            r.html ( processing );
             $j(".waitcls").css({ position:"relative"}); 
            r.height('72%');
            r.load(map.href );
        }


}

stormModalObj.prototype.showLogin =function (  map )
{
    var lvl = 3;
    if (map.authLevel)
    {
        lvl = map.authLevel;
    }
   
    if ( lvl > _curAuthLevel || map.swaplogin)
    {
        var pbarurl = m_pbarPfx;
        if (pbarurl == undefined || pbarurl.length == 0)
        {
            pbarurl = "http://pbar.us.dell.com";
        }
        var url = pbarurl  + m_login_url  +"?level="+ lvl + getLwp();
        if (map.swaplogin)
        {
            url  = url + "&swapLogin=" + map.swaplogin;
        }
        var lwidth = 320;
        var lheight = 350;
        if (map.height)
        {
            lheight = map.height;
        }
        
        if (map.width)
        {
            lwidth = map.width;
        }
        
        var caption = "Login";
        if (map.title)
        {
            caption = map.title;
        }
        var map = { href : url , height : lheight , width : lwidth , title:caption , elm: this};
        this.show ( map , true );
       
    }
}

stormModalObj.prototype.continueAuth = function ()
{

  if ( this.continueMap ) 
    {
        var newMap = $j.extend ( {} , this.continueMap );
     
        setTimeout ( function (){stormModal.show ( newMap );} , 0);
        
    }
    else
    {
  
        window.location.reload();
    }
}
stormModalObj.prototype.setprops = function (map)
{
    this.Title.html ( map.title ? map.title : map.defaultTitle );
   
    if ( map.content )
    {
        this.Content.append ( $j(map.content) ) ;
    }
    else
    {
        this.Content.empty();
    }
    
    if ( map.height )
    {
       if ( !(( map.buttons ) || (map.footerStatus)) )  {
            this.InternalModal.height( map.height );
        }
        
        this.AbsoluteHeight = map.height;       
    }
    else
    {
        this.InternalModal.css( "height","");
    }
    
    if ( map.width ) 
    {
        this.InternalModal.width ( map.width );
        this.InternalModal.css( 'margin-left' , map.width/-2);
    }
    
    this.setfooterButtons ( map.buttons );
    this.setfooterStatus (map.footerStatus );
    
}

stormModalObj.prototype.close = function ()
{
    this.init();
    this.InternalModal.jqmHide();
    
}

//stormModalObj.prototype.footer = this.Footer.html;
stormModalObj.prototype.setheader = function (e)
{
    this.init();
    return this.Title.html(e);
}

stormModalObj.prototype.setfooterButtons = function (e)
{
    this.init();
    e = e ? e : "";
    return this.FooterButtons.html(e);
}
stormModalObj.prototype.setfooterStatus = function (e)
{
    this.init();
    e = e ? e : "";
    return this.FooterStatus.html(e);
}



var _curAuthLevel = 0;

var m_login_url = "/pbar/login.aspx";

var _mwidth = 200;
var _mheight = 200;

function proccessAuthChange ( level )
{
   
    _curAuthLevel= level;
    stormModal.close();
    stormModal.continueAuth();
    
}


var stormModal = new stormModalObj();


function clientPageInit ()
{
    stormModal.addclick  ($j('a[@n_modal]'));
   

}
$j(document).ready( clientPageInit );

addsReady( InitDocumentLoad );
function InitDocumentLoad()
{
    InitClueTip();
    InitToolTips();
    RenderFlash();
}

function InitToolTips()
{
   $j("span[@glid]").livequery(function(){ 
        var gdeco = $j(this).attr("glnodeco");
        var gtitle = $j(this).attr("gltitle");
        if ( typeof(gdeco) == "undefined" )
        {
            $j(this).addClass('glossaryitem'); 
        }
        else
        {
            $j(this).addClass('glossaryitem_nodecoration'); 
        }
        var requestUrl = m_requestURLBase + "&~ttmode=html&~ttid=" + escape( this.attributes.glid.value );
        if ( this.attributes.glmoredetails )
        {
            var ref = src.attributes.glmoredetails.value;
            ref = ref.replace ( /:/g, "~" );
            requestUrl += "&~ttref=" + ref;
        }
        $j(this).attr('rel', requestUrl );
        $j(this).cluetip({arrowHPosition:'offset',delayedClose:typeof(m_containerTimeout)!='undefined'?m_containerTimeout:500,delayedOpen:typeof(hoverovertime)!='undefined'?hoverovertime:500,positionBy:'topBottom',width:'400px',cluetipClass: 'jtip',arrows: true,arrowSize: 'lg',hoverIntent: false,showTitle: false,dropShadow: true,waitImage:false,mouseOutClose:true,sticky:true,closeText:'',onActivate:function(e) {$j("#cluetip-inner").show();return true; },
        onShow:function(e) {
            $j(".itemCloseContainer").click(function() {
                $j("#cluetip").hide();
                return false;});
             var title = $j(".itemContainerTitle").html();
             if( title == null || title.length == 0 || title == "&nbsp;" )
             {
                $j(".itemContainerTitle").html(gtitle);
             }
            return true; }
        });
    });
}

function InitClueTip()
{
    $j(".hv_cluetip") 
    .livequery(function(){  
    $j(this).cluetip({ positionBy:'auto',width:'251px', cluetipClass: 'jtip',arrows: true, hoverIntent: false,showTitle: false,waitImage:false,onActivate:       function(e) {$j("#cluetip-inner").show();return true; } });
    });
    
     $j(".ic_cluetip")
    .livequery(function(){  
        $j(this).cluetip({width:'160px',topOffset:'10',splitTitle: '|', dropShadow: false,arrowSize:'sm', arrows:true,cluetipClass: 'jtip', showTitle: false,positionBy: 'bottomTop',hoverIntent: false,   cursor: 'default', onActivate:       function(e) { $j(this).attr('title', ''); return true; }});
    });
}

function addScript ( jsfile, callback )
{
   var path = m_imgPfx + jsfile;
    var head = document.getElementsByTagName("head")[0];
    if ( head != null )
    {
        try
        {
            var script = document.createElement('script');
            script.type = "text/javascript";
            script.src = path;
            if ( callback )
            {
                script.onreadystatechange = function ()
                {
                    if(callback && ("complete" == script.readyState || "loaded" == script.readyState))
                    {callback();callback= null;}
                }
                script.onload= function ()
                {
                    if ( callback )
                    {
                        callback();callback= null;
                    }
                }
            }
            head.appendChild(script);
        }
        catch( e )
        {
            alert ( e.description );
        }
    }
}

function showDialog( dialog )
{
   if ( typeof ( LoadDialog ) == "undefined" )
   {
        addScript ( "/images/global/js/dialog.js" , function (){showDialog( dialog );});
        return;
   }
   LoadDialog( dialog );
}

function showYPanel ( id , header , body, footer , config )
{
    if ( typeof ( YAHOO ) == "undefined" || typeof ( YAHOO.widget ) == "undefined" )
    {
        addScript ( "/images/global/js/yui/yui.js" , function (){showYPanel( id , header , body, footer, config );});
        return;
    }
    if (  typeof ( YAHOO.storm ) == "undefined" )
    {
        YAHOO.namespace("storm.container");
    }
    var panel = YAHOO.storm.container[id];
    var needsRender = panel == null;

    if ( config == null )
    {
        config = { width:"300px", fixedcenter:true , visible:false, constraintoviewport:true , effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}   };
    }
    if ( config.makeFade )
    {
        if( config.fadeSpeed != null )
        {
            config.effect = {effect:YAHOO.widget.ContainerEffect.FADE,duration:config.fadeSpeed} ;
        }
        else
        {
            config.effect = {effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} ;
        }
    }
    if ( needsRender )
    {
        panel = new YAHOO.widget.Panel(id , config );
        YAHOO.storm.container[id] = panel;
    }
    else
    {
        for ( i in config )
        {
            if ( config[i] != panel.cfg.getProperty( i ))
            {
                panel.cfg.setProperty ( i  , config[i] );
            }
        }
    }
    panel.setHeader ( header );
    panel.setBody ( body );
    panel.setFooter ( footer );
    if ( needsRender )
    {
        panel.render(document.body);
    }
    if( config.visible != false )
    {
        panel.show ();
    }
}

function hideYPannel ( id )
{
   if ( typeof ( YAHOO ) == "undefined" || typeof ( YAHOO.widget ) == "undefined" )
   {
        return;
   }
   var panel = YAHOO.storm.container[id];
   if ( panel != null )
   {
        panel.hide();
   }
}
function getCookie(NameOfCookie)
{
	if (document.cookie.length > 0)
	{
		begin = document.cookie.indexOf(NameOfCookie+"=");
		if (begin != -1)
		{
			begin += NameOfCookie.length + 1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1)
			{
				end = document.cookie.length;
			}
			return unescape( document.cookie.substring(begin, end));
		}
	}
	return "";
}

var trailimage=["", 100, 99] 
var offsetfrommouse=[10,-20] 
var displayduration=1 




function gettrailobj(){


    
 return $j('#trailimageid');
}

function followmouse(e){
var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]
if (typeof e != "undefined"){
xcoord+=e.pageX
ycoord+=e.pageY
}
else if (typeof window.event !="undefined"){
xcoord+=truebody().scrollLeft+event.clientX
ycoord+=truebody().scrollTop+event.clientY
}
var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
if (xcoord+trailimage[1]+3>docwidth || ycoord+trailimage[2]> docheight)
gettrailobj().css({ display:"none"}); 
else 
gettrailobj().css({ display:""}); 

var cssObj = {
        left: xcoord+"px",
        top: ycoord+"px",
        visibility:"visible"
      };
gettrailobj().css(cssObj);

}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail(){
gettrailobj().css({ visibility:"hidden"}); 
$j(document).unbind('mousemove', followmouse)
}

//autocomplete
addsReady ( function(){    
    if ( typeof(m_autocomplete) != "undefined" && m_autocomplete != "" )
    {        
        $j("#searchinput").autocomplete(m_autocomplete, { matchSubset: false, selectFirst: false, scrollHeight: 200 }).result(function(event, item) { $j("form[@name='search']").append("<input type='hidden' name='ref' value='ac' >"); $j("form[@name='search']")[0].submit(); });
	}
	});
	
addsReady ( function (){
    var hostName = window.location.hostname.toLowerCase();
    var pathName = window.location.pathname;
    
    if(m_metricsPathMapping != undefined && m_metricsPathMapping != null)
    {
        if ( pathName.length < 2 )
        {
            if(m_metricsPathMapping[hostName] != null)
            {
                var metricsPath = m_metricsPathMapping[hostName][0];
                var iisLogsPath = m_metricsPathMapping[hostName][1];
                try
                {
            
                    $j('META[@name="METRICSPATH"]').attr('content' , metricsPath);
                    var ti = iisLogsPath + "&ts=" + new Date().getMilliseconds();
                    mi = new Image(); 
                    mi.src = ti;
                }
                catch (e){}
            }
        }
    }
});


